package com.stargate.soft.scenario;

import java.sql.SQLException;

import com.stargate.bd.ConnectionBD;
import com.stargate.bd.bean.Badge;
import com.stargate.bd.bean.Etat;
import com.stargate.bd.dao.DAOFactory;

/**
 * <h1>Désactivation d’un badge</h1>
 *
 */
public class ActiverBadge {

	private Badge badge;

	public ActiverBadge(int numBadge) throws SQLException {
		ConnectionBD.setReadCommitted();

		badge = new Badge(numBadge, Etat.ENABLE);
		DAOFactory.getBadgeDAO().update(badge);

		ConnectionBD.commit();
	}
	
	public Badge getBadge() {
		return badge;
	}
}
